package com.sharemarking.wa.platform.dto.receiveOrderManagement;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.sharemarking.wa.common.eum.OrderOperateTypeEum;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * @author dxy
 */
public class OrderInfoDto {
    @JsonIgnore
    private Integer id;
    private String code;
    private String address;
    private Date transferTime;
    private String carRequirement;
    private String notes;
    private Date createDate;
    private List<OrderWasteListDto> wasteList;
    private Date transferStart;
    private Date transferEnd;
    private Integer transportFees;
    private OrderOperateTypeEum operate;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTransferTime() {
        SimpleDateFormat sf = new SimpleDateFormat("yyyy.MM.dd");
        String start = sf.format(transferStart);
        String end = sf.format(transferEnd);
        String transfer = start + "-" +end;
        return transfer;
    }

    public String getCarRequirement() {
        return carRequirement;
    }

    public void setCarRequirement(String carRequirement) {
        this.carRequirement = carRequirement;
    }

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }

    public Long getCreateDate() {
        if (createDate != null) {
            return createDate.getTime();
        }
        return null;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public List<OrderWasteListDto> getWasteList() {
        return wasteList;
    }

    public void setWasteList(List<OrderWasteListDto> wasteList) {
        this.wasteList = wasteList;
    }

    public void setTransferStart(Date transferStart) {
        this.transferStart = transferStart;
    }

    public void setTransferEnd(Date transferEnd) {
        this.transferEnd = transferEnd;
    }

    public Integer getTransportFees() {
        return transportFees;
    }

    public void setTransportFees(Integer transportFees) {
        this.transportFees = transportFees;
    }

    public OrderOperateTypeEum getOperate() {
        return operate;
    }

    public void setOperate(OrderOperateTypeEum operate) {
        this.operate = operate;
    }
}
